/// <reference path="Drawing/IShape.ts"></reference>
import { Circle } from './Circle';
const hello: string = "Hello World！";
console.log(hello);

class Site {
  name (): void {
    console.log("ni cai");
  }
}
new Site().name()

let x: any = 1;
x = "";
x = true

let tuple: [string, number];

let a: null | undefined | number;
let b: any;
let c: never;

a = 1;
b = 1;
// never 类型可以赋值给 never类型
// c = (() => { throw new Error('exception') })();
// never 类型可以赋值给 数字类型
// a = (() => { throw new Error('exception') })();
// 返回值为 never 的函数可以是抛出异常的情况
function error(message: string): never {
  throw new Error(message);
}
// 返回值为 never 的函数可以是无法被执行到的终止点的情况
function loop(): never {
  while (true) {}
}

let str = '1';
let str2: number = <number><any>str;
console.log(typeof str2);

interface IPerson {
  name: string,
  sayName: () => string
}

let customer: IPerson = {
  name: 'ni cai',
  sayName: (): string => 'Hi'
}

class Person implements IPerson {
  name: string;

  constructor (name: string) {
    this.name = name
  }

  sayName () {
    return this.name
  }

  drawShape (shape: Drawing.IShape) {
    shape.draw();
    new Circle().draw()
  }
}